<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
    <title>更新商品</title>
    <!-- 引入Bootstrap CSS框架 -->

</head>
<body>
<div class="container">
    <h1 class="mt-5">更新商品</h1>
    <form th:action="@{/shop/product/updateProducts/{id}(id=${product.id})}" method="post" th:object="${product}" novalidate>
        <!-- 添加CSRF令牌（如果需要） -->

        <div class="form-group">
            <label for="id">商品ID:</label>
            <input th:value="${product.id}" type="text" class="form-control" id="id" name="id" readonly>
            <small class="form-text text-muted">商品ID不可修改</small>
        </div>
        <div class="form-group">
            <label for="price">商品价格:</label>
            <input th:value="${product.price}" type="text" class="form-control" id="price" name="price" th:field="*{price}" required>
        </div>
        <div class="form-group">
            <label for="name">商品名称:</label>
            <input th:value="${product.name}" type="text" class="form-control" id="name" name="name" th:field="*{name}" required>
        </div>
        <div class="form-group">
            <label for="description">商品描述:</label>
            <textarea th:value="${product.description}" class="form-control" id="description" name="description" th:field="*{description}" required></textarea>
        </div>

        <button type="submit" class="btn btn-primary">更新</button>
    </form>
</div>
</body>
    <style>
        /* custom-style.css */

        /* 基本样式 */
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background-color: #f2f2f2;
        }

        /* 容器样式 */
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background-color: #fff;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        /* 标题样式 */
        h1 {
            color: #333;
            text-align: center;
            margin-bottom: 20px;
        }

        /* 表单样式 */
        form {
            /* 可以添加一些表单级别的样式 */
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }

        .form-group input[type="text"],
        .form-group textarea {
            width: 100%;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
        }

        .form-group input[type="text"]:focus,
        .form-group textarea:focus {
            border-color: #007BFF;
            outline: none;
        }

        /* 按钮样式 */
        .btn-primary {
            display: inline-block;
            background-color: #007BFF;
            color: #fff;
            border: none;
            padding: 10px 20px;
            margin-top: 20px;
            text-decoration: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        .btn-primary:hover {
            background-color: #0056b3;
        }

        /* 其他可能需要的样式 */
        /* ... */
        </style>
</html>